
package org.dromara.system.controller.api;

import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R;
import org.dromara.system.service.ISysPostService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author: zhou shuai
 * @date: 2024/9/26 20:31
 * @version: v1
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/system/post")
public class SysPostApiController {

    private final ISysPostService sysPostService;


    /**
     * 根据岗位 ID 列表查询岗位名称映射关系
     *
     * @param postIds 岗位 ID 列表
     * @return Map，其中 key 为岗位 ID，value 为对应的岗位名称
     */
    @GetMapping("/postName/byPostIds")
    public R<Map<Long, String>> selectPostNamesByIds(@RequestParam("postIds") List<Long> postIds) {
        return R.ok(sysPostService.selectPostNamesByIds(postIds));
    }

}
